<template>
  <div :key="key">
    <center>
      <h2>南京市养老机构综合运营补贴自查报告</h2>
    </center>
    <!-- 基本情况 -->
    <table width="100%" align="center" border="1" cellpadding="5" cellspacing="0" class="table1">
      <caption>基本情况</caption>
      <tr>
        <td>机构名称</td>
        <td colspan="2">{{ data.organizationName }}</td>
        <td>法定代表人</td>
        <td>{{ data.deputyUserName }}</td>
      </tr>
      <tr>
        <td>机构地址</td>
        <td colspan="2">{{ data.organizationAddress }}</td>
        <td>邮政编码</td>
        <td>{{ data.postalCode }}</td>
      </tr>
      <tr>
        <td>联系人</td>
        <td>{{ data.deputyUserName }}</td>
        <td>联系电话</td>
        <td colspan="2">{{ data.deputyUserPhone }}</td>
      </tr>
      <tr>
        <td>营业执照（民非）证号</td>
        <td>{{data.organizationLicense }}</td>
        <td>机构设置证号（备案）</td>
        <td colspan="2">{{ data.organizationFiling }}</td>
      </tr>
      <tr>
        <td>核定床位数</td>
        <td>{{data.realBedNum }}张</td>
        <td>入住老人数</td>
        <td colspan="2">{{ data.checkinOldmanNum }}</td>
      </tr>
    </table>
    <br/>
    <!--自查情况  -->
    <table width="100%" align="center" border="1" cellpadding="5" cellspacing="0" class="table2">
      <caption>自查情况</caption>
      <tr>
        <th width="10%">自查时间</th>
        <td>{{ data.selfCheckDate }}</td>
        <th width="10%">自查方式</th>
        <td>{{ data.selfCheckWay }}</td>
        <th>参与人数</th>
        <td>{{ data.partakeNum }}</td>
        <th>参与比例（百分比）</th>
        <td colspan="2">{{ data.partakeRate }}</td>
      </tr>
      <tr>
        <th rowspan="5" width="10%">自查内容</th>
        <td style="font-weight: 700;">1.是否存在虚假广告宣传</td>
        <th>是</th>
        <td>{{ data.unrealPublicityFlagLabel=='是'?'√':'' }}</td>
        <th>否</th>
        <td>{{ data.unrealPublicityFlagLabel == '否' ? '√' : '' }}</td>
        <th>备注</th>
        <td colspan="2">{{data.unrealPublicityNote }}</td>
      </tr>
      <tr>
        <td style="font-weight: 700;">2.是否按照协议提供服务</td>
        <th>是</th>
        <td>{{ data.agreementServiceFlagLabel == '是' ? '√' : '' }}</td>
        <th>否</th>
        <td>{{ data.agreementServiceFlagLabel == '否' ? '√' : '' }}</td>
        <th>备注</th>
        <td colspan="2">{{ data.agreementServiceNote }}</td>
      </tr>
       <tr>
          <td style="font-weight: 700;">3.是否侵害老人合法权益</td>
          <th>是</th>
          <td>{{ data.infringementFlagLabel == '是' ? '√' : '' }}</td>
          <th>否</th>
          <td>{{ data.infringementFlagLabel == '否' ? '√' : '' }}</td>
          <th>备注</th>
          <td colspan="2">{{ data.infringementNote }}</td>
        </tr>
         <tr>
          <td style="font-weight: 700;">4.老人对机构的综合评价</td>
          <th>非常满意</th>
          <td>{{ data.comprehensiveEvaluationLabel == '非常满意' ? '√' : '' }}</td>
          <th>基本满意</th>
          <td>{{ data.comprehensiveEvaluationLabel == '基本满意' ? '√' : '' }}</td>
          <th>不满意</th>
          <td colspan="2">{{ data.comprehensiveEvaluationLabel == '不满意' ? '√' : '' }}</td>
        </tr>
         <tr>
          <td style="font-weight: 700;">5.其他事项</td>
          <td colspan="7">{{ data.otherThings }}</td>
        </tr>
        <tr>
          <th :rowspan="questionData.length">自查内容</th>
          <td colspan="8">1.{{ questionData[0].questionOption }}</td>
        </tr>
        <tr v-for="(item,index) in questionData.slice(1)" :key="index">
          <td colspan="8">{{index+2+'.'}}{{ item.questionOption }}</td>
        </tr>
        <tr>
          <th width="10%">自查结论</th>
          <th>非常满意</th>
          <td>{{ data.selfCheckResultLabel == '非常满意' ? '√' : '' }}</td>
          <th>基本满意</th>
          <td>{{ data.selfCheckResultLabel == '基本满意' ? '√' : '' }}</td>
          <th>不满意</th>
          <td>{{data.selfCheckResultLabel == '不满意' ? '√' : ''}}</td>
          <th>满意率（百分比）</th>
          <td>{{ data.checkinSatisfyRate }}</td>
        </tr>
    </table>
    <br/>
    <!-- 调查员签名 -->
    <table width="100%" align="center" border="1" cellpadding="5" cellspacing="0" class="table3">
      <caption>调查员签名</caption>
      <tr v-for="(item,index) in InvestigatorData" :key="index">
        <td width="10%">姓名</td>
        <td  width="10%">{{ item.investigatorName }}</td>
        <td  width="10%">职务</td>
        <td>{{ item.investigatorDuty }}</td>
      </tr>
    </table>
    <br/>
    <!-- 被调查人签名 -->
    <table width="100%" align="center" border="1" cellpadding="5" cellspacing="0" class="table4">
      <caption>被调查人签名</caption>
      <tr>
          <td>姓名</td>
          <td colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>职务</td>
          <td colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>姓名</td>
          <td colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>
          <td>职务</td>
          <td colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>
      </tr>
      <tr v-for="item in 5" :key="item">
          <td>姓名</td>
          <td colspan="1"></td>
          <td>职务</td>
          <td colspan="1"></td>
          <td>姓名</td>
          <td colspan="1"></td>
          <td>职务</td>
          <td colspan="1"></td>
      </tr>
      <tr>
        <th colspan="8">本机构承诺以上及所附数据资料真实有效，如有不实，愿承担相关处罚。</th>
      </tr>
      <tr>
        <th colspan="8">负责人签名：                 （单位盖章）</th>
      </tr>
      <tr>
        <th colspan="8">年               月               日</th>
      </tr>
    </table>
  </div>
</template>

<script setup lang="ts">
import apiMod from '@/apiMod/index'
type Props = {
  nowRowData?: any,
}
const props = withDefaults(defineProps<Props>(), {
  nowRowData: {}
})
let data: any = {}
data = props.nowRowData
let questionData:any= ref([
  {questionOption:''}
])
let InvestigatorData:any = ref([])

let key = ref(1)
// 获取问题数据
const getQuestionData = (id) => {
  apiMod.dpOrgOperateSelfQuestion_page({ headId: id,pageParaPO:{size:1000000,current:1} }).then(res => {
    questionData = res.data.records
    key.value = Math.random()
  })
}
getQuestionData(props.nowRowData.soleValue)
// 获取调查人信息
const getInvestigatorData = (id) => {
  apiMod.dpOrgOperateSelfInvestigator_page({ headId: id,pageParaPO:{size:1000000,current:1} }).then(res => {
    InvestigatorData = res.data.records
    key.value = Math.random()
  })
}
getInvestigatorData(props.nowRowData.soleValue)
</script>
<style scoped lang="scss">
.table1>tr>td:nth-child(odd) {
  font-weight: 700;
  width: 20%;
}

.table3>tr>td:nth-child(odd) {
  font-weight: 700;
}
.table4>tr>td:nth-child(odd) {
  font-weight: 700;
}
</style>